package m.jclecai.com.adapter;

import android.content.Context;
import android.view.ViewGroup;

import java.util.List;

import m.jclecai.com.R;
import m.jclecai.com.adapter.base.ViewHolerAdapter;
import m.jclecai.com.adapter.holder.LuckyGiftHolder;
import m.jclecai.com.bean.LuckyWalkBean;

/**
 * Created by ZD on 2017/7/5.
 */

public class LuckyGigtAdapter extends ViewHolerAdapter<LuckyGiftHolder> {

    List<LuckyWalkBean> beanList;
    Context context;

    public LuckyGigtAdapter(List<LuckyWalkBean> beanList, Context context) {
        this.beanList = beanList;
        this.context = context;
    }

    @Override
    public LuckyGiftHolder onCreateViewHolder(int position, ViewGroup parent) {
        return new LuckyGiftHolder(context, R.layout.item_lucky_gift);
    }

    @Override
    public void onBindViewHolder(int position, LuckyGiftHolder luckyGiftHolder) {
        luckyGiftHolder.init(beanList.get(position));
    }

    @Override
    public int getCount() {
        return beanList.size();
    }
}
